From fd3515acc70a9814453b6fe795b00f7fcb3ccd68 Mon Sep 17 00:00:00 2001 From: "maf46@burn.cl.cam.ac.uk" Date: Tue, 17 May 2005 13:20:17 +0000 Subject: [PATCH] bitkeeper revision 1.1430 (4289ef91cnLSZ2abQmRijAYRLrwMjQ) Bug fix for shadow external mode (i.e. VMX) operation, fixing an overly aggressive new ASSERT added with the light weight shadow code. --- xen/arch/x86/domain.c | 3 ++- xen/arch/x86/shadow.c | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 34c79ce68a..e99f4f4743 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -364,7 +364,8 @@ static int vmx_final_setup_guest( /* Put the domain in shadow mode even though we're going to be using * the shared 1:1 page table initially. It shouldn't hurt */ shadow_mode_enable(ed->domain, - SHM_enable|SHM_refcounts|SHM_translate|SHM_external); + SHM_enable|SHM_write_all|SHM_refcounts| + SHM_translate|SHM_external); } return 0; diff --git a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c index b94e763f51..05a34bf820 100644 --- a/xen/arch/x86/shadow.c +++ b/xen/arch/x86/shadow.c @@ -2307,9 +2307,10 @@ static int resync_all(struct domain *d, u32 stype) // guest page. // This only applies when we have writable page tables. // - if ( (stype == PGT_l1_shadow) && !VM_ASSIST(d, VMASST_TYPE_writable_pagetables) ) - continue; - if ( (stype != PGT_l1_shadow) && !shadow_mode_write_all(d) ) + if ( !shadow_mode_write_all(d) && + !((stype == PGT_l1_shadow) && + VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) ) + // Page is not writable -- no resync necessary continue; } @@ -2336,7 +2337,8 @@ static int resync_all(struct domain *d, u32 stype) l1_pgentry_t *shadow1 = shadow; l1_pgentry_t *snapshot1 = snapshot; - ASSERT(VM_ASSIST(d, VMASST_TYPE_writable_pagetables)); + ASSERT(VM_ASSIST(d, VMASST_TYPE_writable_pagetables) || + shadow_mode_write_all(d)); if ( !shadow_mode_refcounts(d) ) revalidate_l1(d, guest1, snapshot1); -- 2.30.2